﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;
using System.IO.IsolatedStorage;
using System.ComponentModel;
using Microsoft.Phone.Shell;

namespace PhoneInfo.Page
{
    public partial class MoreFromInfo : PhoneApplicationPage
    {
        public MoreFromInfo()
        {
            InitializeComponent();
        }
        private void ListBox_Tap(object sender, System.Windows.Input.GestureEventArgs e)
        {
            if (sender==null) return;
            ListBox lb = sender as ListBox;
            if(lb==null) return;
            switch(lb.SelectedIndex)
            {
                case 0:
                    //精品软件
                    {
                        string pageName = "/Page/ShowDownload.xaml";
                        NavigationService.Navigate(new Uri(pageName, UriKind.Relative));
                    }
                    break;
                case 1:
                    //账号管理
                    {
                        string pageName = "/Page/userManager.xaml";
                        NavigationService.Navigate(new Uri(pageName, UriKind.Relative));
                    }
                    break;
                case 2:
                    //我的收藏
                    {
                        string pageName = "/Page/Collection.xaml";
                        NavigationService.Navigate(new Uri(pageName, UriKind.Relative));
                    }
                    break;
                case 3:
                    //乐讯地图
                    {
                        string pageName = "/Page/LexunMap.xaml";
                        NavigationService.Navigate(new Uri(pageName, UriKind.Relative));
                    }
                    break;
                case 4:
                    //设置
                    {
                        string pageName = "/Page/SoftSiting.xaml";
                        NavigationService.Navigate(new Uri(pageName, UriKind.Relative));
                    }
                    break;
                case 5:
                    {//留言板
                        string pageName = "/Page/MessageBoard.xaml";
                        NavigationService.Navigate(new Uri(pageName, UriKind.Relative));
                    }
                    break;
                case 6:
                    //关于
                    {
                        string pageName = "/Page/About.xaml";
                        NavigationService.Navigate(new Uri(pageName, UriKind.Relative));
                    }
                    break;
            }
        }
        protected override void OnBackKeyPress(CancelEventArgs e)
        {
            string pageName = "/Page/main.xaml";
            NavigationService.Navigate(new Uri(pageName, UriKind.Relative));
        }
    }
}